package com.atguigu.tingshu.album.service.impl;

import com.atguigu.tingshu.album.mapper.BaseAttributeMapper;
import com.atguigu.tingshu.album.mapper.BaseCategory1Mapper;
import com.atguigu.tingshu.album.mapper.BaseCategory2Mapper;
import com.atguigu.tingshu.album.mapper.BaseCategory3Mapper;
import com.atguigu.tingshu.album.service.BaseCategoryService;
import com.atguigu.tingshu.model.album.BaseAttribute;
import com.atguigu.tingshu.model.album.BaseCategory1;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
@SuppressWarnings({"all"})
public class BaseCategoryServiceImpl extends ServiceImpl<BaseCategory1Mapper, BaseCategory1> implements BaseCategoryService {

	@Autowired
	private BaseCategory1Mapper baseCategory1Mapper;

	@Autowired
	private BaseCategory2Mapper baseCategory2Mapper;

	@Autowired
	private BaseCategory3Mapper baseCategory3Mapper;

	@Autowired
	private BaseAttributeMapper baseAttributeMapper;


	/**
	 * 根据一级分类Id获取分类（标签名包含标签值） 列表
	 * @param category1Id 一级分类id
	 * @return
	 */
	@Override
	public List<BaseAttribute> getAttributesByCategory1Id(Long category1Id) {
		List<BaseAttribute> baseAttributeList = new ArrayList<>();
		baseAttributeList = baseAttributeMapper.getAttributesByCategory1Id(category1Id);
		return baseAttributeList;
	}
}
